<?php

namespace Config;

use CodeIgniter\Validation\CreditCardRules;
use CodeIgniter\Validation\FileRules;
use CodeIgniter\Validation\FormatRules;
use CodeIgniter\Validation\Rules;

class Validation
{
    //--------------------------------------------------------------------
    // Setup
    //--------------------------------------------------------------------

    /**
     * Stores the classes that contain the
     * rules that are available.
     *
     * @var string[]
     */
    public $ruleSets = [
        Rules::class,
        FormatRules::class,
        FileRules::class,
        CreditCardRules::class,
    ];

    /**
     * Specifies the views that are used to display the
     * errors.
     *
     * @var array<string, string>
     */
    public $templates = [
        'list' => 'CodeIgniter\Validation\Views\list',
        'single' => 'CodeIgniter\Validation\Views\single',
    ];

    //--------------------------------------------------------------------
    // Rules
    //--------------------------------------------------------------------


    #----------------
    # bot
    #----------------
    public $port = [
        'port' => [
            'rules' => 'required|integer',
            'errors' => [
                'required' => ' The {field} field. You must choose a integer.'
            ]
        ],
    ];

    public $domain_host_account_device = [
        'domain' => [
            'rules' => 'required',
            'errors' => [
                'required' => 'You must choose a {field}.'
            ]
        ],
        'host' => [
            'rules' => 'required|valid_ip',
            'errors' => [
                'valid_email' => 'Please check the {field} field. It does not appear to be valid.'
            ]
        ],
        'account' => [
            'rules' => 'required',
            'errors' => [
                'required' => 'You must choose a {field}.'
            ]
        ],
        'device' => [
            'rules' => 'required',
            'errors' => [
                'required' => 'You must choose a {field}.'
            ]
        ],
    ];


    #----------------
    # interflow
    #----------------
    public $account_message = [
        'account' => [
            'rules' => 'required',
            'errors' => [
                'required' => 'You must choose a {field}.'
            ]
        ],
        'message' => [
            'rules' => 'required',
            'errors' => [
                'required' => 'You must choose a {field}.'
            ]
        ],
    ];
}
